//
// Decompiled by Jadx - 562ms
//
package fi;

import a.i;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.widget.EditText;
import android.widget.TextView;
import androidx.activity.b;
import androidx.appcompat.app.t;
import cc.h;
import cc.i;
import de.robv.android.xposed.XposedHelpers;
import fh.f;
import fi.c;
import fi.w;
import fm.g;
import fn.f;
import fn.j;
import fn.y;
import gc.aa;
import gc.ac;
import gc.ag;
import gc.al;
import gc.ap;
import gc.aw;
import gc.bt;
import gc.bv;
import gc.cf;
import gc.co;
import gc.z;
import ge.c;
import gf.ab;
import gf.ac;
import gf.p;
import gf.s;
import gj.k;
import gj.l;
import gj.m;
import gj.o;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import me.plusne.GreenDao.dao.LookHomeJsonDao;
import me.plusne.GreenDao.dao.WeChatMessageDao;
import me.plusne.NativeTools;
import me.plusne.common.Http.Home;
import me.plusne.common.Http.Hook;
import me.plusne.common.Json.JsonHookStatic;
import me.plusne.common.Json.Login.JsonTempUserDecrypt;
import me.plusne.common.Json.Soul.JsonFollowType;
import me.plusne.common.Json.Soul.JsonLurkPost;
import me.plusne.common.Json.Soul.JsonSoulGetUserInfos;
import me.plusne.common.Json.Soul.JsonSoulSeeList;
import org.luckypray.dexkit.result.FieldData;
import org.luckypray.dexkit.result.MethodData;
import p.e;
import s.m;
import s.n;
import s.p;
import s.x;
import x.d;

public final class k implements w.f, ag.b, w.e, ac.b, f.a, ac.c, w.c, k.c, p.c, e.b, w.b {
    public final int a;
    public final Object d;

    public k(int i, Object obj) {
        this.a = i;
        this.d = obj;
    }

    public final void b(String str, Object[] objArr) {
        String message;
        int i = this.a;
        Object obj = this.d;
        switch (i) {
            case 3:
                z.b bVar = (z.b) obj;
                MethodData methodData = z.cp;
                if (TextUtils.isEmpty(str)) {
                    message = "返回值为空";
                } else {
                    JsonLurkPost jsonLurkPost = (JsonLurkPost) b.c(str, JsonLurkPost.class);
                    if (jsonLurkPost == null) {
                        message = "解析Json错误";
                    } else if (jsonLurkPost.getCode() == 10001) {
                        if (jsonLurkPost.getData() != null && jsonLurkPost.getData().getPostInfoResponse() != null) {
                            if (jsonLurkPost.getData().getPostInfoResponse().getAuthorId() > 0) {
                                bVar.b(String.valueOf(jsonLurkPost.getData().getPostInfoResponse().getAuthorId()));
                                return;
                            }
                            message = "ID数据错误";
                        } else {
                            message = "未发现需要的数据";
                        }
                    } else {
                        message = jsonLurkPost.getMessage();
                    }
                }
                bVar.a(message);
                return;
            default:
                aw awVar = (aw) obj;
                FieldData fieldData = aw.cp;
                awVar.getClass();
                if (!TextUtils.isEmpty(str)) {
                    JsonSoulGetUserInfos jsonSoulGetUserInfos = (JsonSoulGetUserInfos) b.c(str, JsonSoulGetUserInfos.class);
                    if (jsonSoulGetUserInfos.getCode() == 10001 && jsonSoulGetUserInfos.getData() != null && !jsonSoulGetUserInfos.getData().isEmpty()) {
                        JsonHookStatic jsonHookStatic = y.by;
                        fn.b.k(jsonHookStatic.getSoul().getToChatUserId(), 6, String.valueOf(((JsonSoulGetUserInfos.DataBean) jsonSoulGetUserInfos.getData().get(0)).getBirthday()), "");
                        jsonHookStatic.getMainHandler().post(new aa(4, awVar, jsonSoulGetUserInfos));
                        return;
                    }
                    return;
                }
                return;
        }
    }

    public final void c() {
        int i = this.a;
        Object obj = this.d;
        switch (i) {
            case 14:
                c.ct((c) obj);
                return;
            default:
                s sVar = (s) obj;
                int i2 = s.a;
                sVar.getClass();
                if (p.cs) {
                    y.co(Boolean.FALSE, "MessageNotifier");
                    gf.z.cu((TextView) null);
                    gf.k.cv();
                } else {
                    gf.k.cs();
                }
                p.cs = !p.cs;
                p.db(sVar.b.cy);
                ab.cx();
                String cf = y.cf("secretFriend_allShowTitle", "");
                if (!TextUtils.isEmpty(cf)) {
                    r.f i3 = r.f.i();
                    i3.n();
                    i3.g = 0;
                    i3.l(cf);
                    return;
                }
                return;
        }
    }

    public final void call() {
        ((o) this.d).getClass();
        JsonHookStatic jsonHookStatic = y.by;
        new gj.k(jsonHookStatic.getActivity());
        r.f fVar = new r.f(jsonHookStatic.getActivity());
        fVar.n();
        fVar.l("刷新成功");
    }

    public final void e(Method method, Object[] objArr) {
        int i = this.a;
        Object obj = this.d;
        switch (i) {
            case 5:
                JsonFollowType.DataDTO.UserListDTO userListDTO = (JsonFollowType.DataDTO.UserListDTO) obj;
                Object[] objArr2 = new Object[1];
                StringBuilder sb = new StringBuilder("[取消关注]  ");
                sb.append(userListDTO.getSignature());
                sb.append("  ->  ");
                Object obj2 = objArr[0];
                Object obj3 = "成功";
                if (obj2 == null) {
                    obj2 = "成功";
                }
                sb.append(obj2);
                objArr2[0] = sb.toString();
                j.bi(objArr2);
                r.f i2 = r.f.i();
                i2.k();
                StringBuilder sb2 = new StringBuilder("[取消关注]  ");
                sb2.append(userListDTO.getSignature());
                sb2.append("  ->  ");
                Object obj4 = objArr[0];
                if (obj4 != null) {
                    obj3 = obj4;
                }
                sb2.append(obj3);
                i2.l(sb2.toString());
                return;
            case 6:
                JsonSoulSeeList jsonSoulSeeList = (JsonSoulSeeList) obj;
                if (method.getName().equals("onNext")) {
                    List list = (List) objArr[0];
                    Iterator it = jsonSoulSeeList.getData().getList().iterator();
                    while (true) {
                        boolean hasNext = it.hasNext();
                        ArrayList arrayList3 = ap.cp;
                        if (hasNext) {
                            JsonSoulSeeList.DataDTO.ListDTO listDTO = (JsonSoulSeeList.DataDTO.ListDTO) it.next();
                            for (Object obj5 : list) {
                                if (listDTO.getUserIdEcpt().equals(j.as(obj5, "userIdEcpt"))) {
                                    g gVar = new g();
                                    gVar.i = j.as(obj5, "avatarName");
                                    gVar.e = j.as(obj5, "signature");
                                    gVar.f = listDTO.getTime();
                                    gVar.h = listDTO.getCount();
                                    gVar.d = j.as(obj5, "userIdEcpt");
                                    arrayList3.add(gVar);
                                }
                            }
                        } else {
                            fh.b bVar = ap.cr;
                            bVar.a.addAll(arrayList3);
                            bVar.notifyDataSetChanged();
                            if (jsonSoulSeeList.getData().getList().get(jsonSoulSeeList.getData().getList().size() - 1) != null && jsonSoulSeeList.getData().getList().get(jsonSoulSeeList.getData().getList().size() - 1).getTime() > 0) {
                                ap.dn(jsonSoulSeeList.getData().getList().get(jsonSoulSeeList.getData().getList().size() - 1).getTime());
                                return;
                            }
                            return;
                        }
                    }
                } else {
                    return;
                }
                break;
            case 7:
                Map map = (Map) obj;
                ArrayList arrayList4 = ap.cp;
                Object obj6 = objArr[0];
                if (obj6 != null) {
                    ap.dj = (List) XposedHelpers.getObjectField(obj6, "postList");
                    new Thread(new fp.aa(2)).start();
                }
                if (y.ch("ReqRecommendedAuto", false)) {
                    int cd = y.cd(1000, "autoNumStop");
                    if (ap.cw <= cd && ap.cy <= cd && ap.da <= cd && ap.dc <= cd && ap.dd <= cd && ap.df <= cd && ap.dh <= cd) {
                        new Handler(Looper.getMainLooper()).postDelayed(new al(0, map), 200L);
                        return;
                    } else {
                        y.co(Boolean.FALSE, "ReqRecommendedAuto");
                        return;
                    }
                }
                return;
            default:
                bt btVar = (bv.g) obj;
                FieldData fieldData = bv.cp;
                if (method.getName().equals("onNext")) {
                    XposedHelpers.getIntField(objArr[0], "roundCount");
                    bt btVar2 = btVar;
                    String str = (String) btVar2.b;
                    z.dn(btVar2.a, btVar2.d, str, (String) btVar2.c, "");
                    fn.b.k("reply_userId_" + str, 7, "", "");
                    return;
                }
                return;
        }
    }

    public final void f(File file) {
        int i = this.a;
        Object obj = this.d;
        switch (i) {
            case 0:
                ((i) obj).d.append(file.getPath());
                return;
            case 1:
                ((h) obj).d.append(file.getPath());
                return;
            default:
                ((cc.j) obj).g.append(file.getPath());
                return;
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:40:0x0104, code lost:
    
        if (r10.isEmpty() != false) goto L41;
     */
    /* JADX WARN: Code restructure failed: missing block: B:41:0x011b, code lost:
    
        r3.a = gc.ap.cq;
        r3.notifyDataSetChanged();
        gc.ap.ct = ((fm.g) gc.ap.cq.get(0)).a.longValue();
        r10 = gc.ap.cq;
        gc.ap.cu = ((fm.g) r10.get(r10.size() - 1)).a.longValue();
     */
    /* JADX WARN: Code restructure failed: missing block: B:42:0x0147, code lost:
    
        return;
     */
    /* JADX WARN: Code restructure failed: missing block: B:43:0x0115, code lost:
    
        androidx.activity.b.u("没有更多记录了");
     */
    /* JADX WARN: Code restructure failed: missing block: B:44:?, code lost:
    
        return;
     */
    /* JADX WARN: Code restructure failed: missing block: B:46:0x0113, code lost:
    
        if (r10.isEmpty() != false) goto L41;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void g(w wVar, boolean z) {
        int i = this.a;
        Object obj = this.d;
        switch (i) {
            case 4:
                fh.b bVar = (fh.b) obj;
                if (z) {
                    long j = ap.ct;
                    LookHomeJsonDao lookHomeJsonDao = y.by.getDb().u;
                    lookHomeJsonDao.getClass();
                    a.g gVar = new a.g(lookHomeJsonDao);
                    i.b f = LookHomeJsonDao.Properties.To.f(z.eb());
                    d dVar = LookHomeJsonDao.Properties.Id;
                    Long valueOf = Long.valueOf(j);
                    dVar.getClass();
                    gVar.l(f, new a.i[]{new i.b(dVar, "<?", valueOf)});
                    gVar.i(ap.cs);
                    ArrayList j2 = gVar.j();
                    ap.cq = j2;
                    break;
                } else {
                    ArrayList dm = ap.dm(ap.cu);
                    ap.cq = dm;
                    break;
                }
            case 12:
                File file = (File) obj;
                String str = cf.cp;
                if (z) {
                    Intent intent = new Intent("android.intent.action.VIEW");
                    intent.addCategory("android.intent.category.DEFAULT");
                    intent.setDataAndType(Uri.fromFile(file), "text/html");
                    JsonHookStatic jsonHookStatic = y.by;
                    ComponentName resolveActivity = intent.resolveActivity(jsonHookStatic.getActivity().getPackageManager());
                    Activity activity = jsonHookStatic.getActivity();
                    if (resolveActivity == null) {
                        intent = Intent.createChooser(intent, "");
                    }
                    activity.startActivity(intent);
                    return;
                }
                return;
            case 17:
                me.plusne.Adapter.Login.h hVar = (f.b) obj;
                fn.f fVar = fn.f.c;
                Runnable runnable = fVar.e;
                if (runnable != null) {
                    fVar.d.removeCallbacks(runnable);
                    fn.f.a = false;
                }
                if (!z && hVar != null) {
                    hVar.c();
                    return;
                }
                return;
            case 18:
                m mVar = (m) obj;
                if (!z) {
                    gj.k kVar = mVar.a;
                    y.e(kVar.d);
                    l lVar = new l(mVar, kVar.d, wVar);
                    if (y.by.getUserInfo() != null) {
                        t.c().j(((Hook) dq.b.b(Hook.class)).logout().subscribeWith(lVar));
                        return;
                    }
                    return;
                }
                mVar.getClass();
                return;
            case 20:
                me.plusne.Adapter.Login.g gVar2 = (m.a) obj;
                fn.b.l(Boolean.valueOf(z), "autoLogin");
                if (gVar2 != null) {
                    gVar2.e(fn.b.g("login_user", ""), fn.b.g("login_pass", ""));
                    return;
                }
                return;
            case 21:
                n nVar = (n) obj;
                nVar.e(nVar.c);
                return;
            default:
                JsonHookStatic jsonHookStatic2 = y.by;
                jsonHookStatic2.setMd5(((JsonTempUserDecrypt) obj).getMd5());
                y.co(Long.valueOf(jsonHookStatic2.getVersionCode()), "update_version");
                if (z) {
                    r.g.e(jsonHookStatic2.getActivity(), false);
                    return;
                }
                return;
        }
    }

    public final void h(String str, String str2, w wVar, boolean z) {
        int i = this.a;
        Object obj = this.d;
        switch (i) {
            case 22:
                p.a aVar = (p.a) obj;
                if (!z) {
                    aVar.getClass();
                    wVar.az();
                    return;
                }
                s.p pVar = aVar.a;
                y.f(pVar.a, "正在注册...");
                cc.e eVar = pVar.c;
                String obj2 = ((EditText) eVar.e).getText().toString();
                String obj3 = eVar.b.getText().toString();
                String obj4 = eVar.a.getText().toString();
                String obj5 = ((EditText) eVar.c).getText().toString();
                String obj6 = ((EditText) eVar.d).getText().toString();
                t.c().j(((Home) dq.b.b(Home.class)).reg(obj2, obj3, obj4, str, obj5, obj6).subscribeWith(new s.o(aVar, pVar.a, wVar)));
                return;
            default:
                s.y yVar = (s.y) obj;
                yVar.getClass();
                if (!z) {
                    wVar.az();
                    return;
                }
                boolean g = r.g.g(str);
                s.z zVar = yVar.a;
                if (!g) {
                    b.r(zVar.a, "输入的QQ号码格式不正确");
                    return;
                }
                y.f(zVar.a, "正在绑定中..");
                String o = r.g.o();
                t.c().j(((Home) dq.b.b(Home.class)).bindInfo(o, str).subscribeWith(new x(yVar, zVar.a, wVar)));
                return;
        }
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Code restructure failed: missing block: B:37:0x005e, code lost:
    
        if (r8.equals("仅自己可见") == false) goto L7;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void i(w wVar, c.a aVar, int i, int i2) {
        String as;
        String styleName;
        String str;
        int i3 = this.a;
        char c = 1;
        Object obj = this.d;
        switch (i3) {
            case 10:
                aw.p pVar = (aw.p) obj;
                pVar.getClass();
                JsonHookStatic jsonHookStatic = y.by;
                jsonHookStatic.getSpeak().setStyleName(aVar.getTitle());
                jsonHookStatic.getSpeak().setStyle(aVar.getDesc());
                cc.x xVar = pVar.a;
                TextView textView = xVar.d;
                if (TextUtils.isEmpty(jsonHookStatic.getSpeak().getStyleName())) {
                    styleName = "未选择";
                } else {
                    styleName = jsonHookStatic.getSpeak().getStyleName();
                }
                textView.setText(styleName);
                xVar.f.setText(jsonHookStatic.getSpeak().getLocalName());
                wVar.c.dismiss();
                return;
            case 13:
                AtomicReference atomicReference = (AtomicReference) obj;
                HashMap hashMap = co.a;
                String title = aVar.getTitle();
                title.getClass();
                switch (title.hashCode()) {
                    case -2054446030:
                        if (title.equals("不给Ta看")) {
                            c = 0;
                            break;
                        }
                        c = 65535;
                        break;
                    case -1837433986:
                        break;
                    case -426806508:
                        if (title.equals("仅陌生人可见")) {
                            c = 2;
                            break;
                        }
                        c = 65535;
                        break;
                    case 327049431:
                        if (title.equals("仅校园吧用户可见")) {
                            c = 3;
                            break;
                        }
                        c = 65535;
                        break;
                    case 412093293:
                        if (title.equals("仅话题广场可见")) {
                            c = 4;
                            break;
                        }
                        c = 65535;
                        break;
                    case 742834573:
                        if (title.equals("广场可见")) {
                            c = 5;
                            break;
                        }
                        c = 65535;
                        break;
                    case 2077764369:
                        if (title.equals("仅主页可见")) {
                            c = 6;
                            break;
                        }
                        c = 65535;
                        break;
                    default:
                        c = 65535;
                        break;
                }
                switch (c) {
                    case 0:
                        str = "BLOCK";
                        break;
                    case 1:
                        str = "PRIVATE";
                        break;
                    case 2:
                        str = "STRANGER";
                        break;
                    case 3:
                        str = "CAMPUS";
                        break;
                    case 4:
                        str = "TAG";
                        break;
                    case 5:
                        str = "PUBLIC";
                        break;
                    case 6:
                        str = "HOMEPAGE";
                        break;
                }
                atomicReference.set(str);
                String str2 = z.do(z.eb());
                if (!TextUtils.isEmpty((CharSequence) atomicReference.get())) {
                    new Thread((Runnable) new aa(5, str2, atomicReference)).start();
                    return;
                }
                return;
            default:
                ac.b bVar = (ac.b) obj;
                int i4 = ac.b.a;
                bVar.getClass();
                String title2 = aVar.getTitle();
                title2.getClass();
                if (!title2.equals("修改聊天记录")) {
                    if (title2.equals("转发消息")) {
                        gf.y.ct(gf.y.cs(j.as(gf.ac.cq, "field_talker"), j.as(gf.ac.cq, "field_content")));
                        wVar.az();
                        return;
                    }
                    return;
                }
                int i5 = JsonHookStatic.l;
                JsonHookStatic jsonHookStatic2 = y.by;
                if (NativeTools.n(i5, jsonHookStatic2.getUserInfo())) {
                    WeChatMessageDao weChatMessageDao = jsonHookStatic2.getDb().aa;
                    weChatMessageDao.getClass();
                    a.g gVar = new a.g(weChatMessageDao);
                    gVar.l(WeChatMessageDao.Properties.Field_msgId.f(Long.valueOf(XposedHelpers.getLongField(gf.ac.cq, y.cj("msgId")))), new a.i[0]);
                    gVar.i(1);
                    fm.n nVar = (fm.n) gVar.k();
                    gf.ac acVar = bVar.b;
                    acVar.cr = nVar;
                    w wVar2 = new w(jsonHookStatic2.getActivity());
                    wVar2.bj(fi.e.INPUT_MULTI);
                    wVar2.aj = "修改聊天记录";
                    wVar2.bb();
                    wVar2.ak = "不会更改数据库的记录(空为删除修改,需要重新进入下聊天框)";
                    wVar2.bb();
                    fm.n nVar2 = acVar.cr;
                    if (nVar2 != null) {
                        as = nVar2.c;
                    } else {
                        as = j.as(gf.ac.cq, "field_content");
                    }
                    wVar2.k = as;
                    wVar2.w = new fg.f(12, bVar, wVar);
                    wVar2.bk();
                    return;
                }
                return;
        }
    }

    public final void j(int i) {
        cc.f fVar = (cc.f) this.d;
        FieldData fieldData = aw.cp;
        ((TextView) fVar.e).setText("(" + i + ")");
    }
}
